import axios from '@u/request'
// 加入购物车 /shopping-cart/add
const addCart = (params = {}) => {
  return axios.post('/shopping-cart/add', params)
}
// 读取购物车数据 /shopping-cart/info
const getCartInfo = (params = {}) => {
  return axios.get('/shopping-cart/info', {params})
}
// 修改购物车商品购买数量 /shopping-cart/modifyNumber
const changeItemNum = (params = {}) => {
  return axios.post('/shopping-cart/modifyNumber', params)
}
// 移除购物车中某个商品 /shopping-cart/remove
const removeCatItem = (params = {}) => {
  return axios.post('/shopping-cart/remove', params)
}
// 修改购物车商品选中状态 /shopping-cart/select
const changeItemSelected = (params = {}) => {
  return axios.post('/shopping-cart/select', params)
}

export {
  addCart,
  getCartInfo,
  changeItemNum,
  removeCatItem,
  changeItemSelected
}